<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ATOMISM: src/Base/muparser_v2_2_3/muParserTest.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">ATOMISM
   
   </div>
   <div id="projectbrief">A C++ library and a python module to study the motion of undiviseable entities</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">src/Base/muparser_v2_2_3/muParserTest.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="mu_parser_test_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">                 __________                                      </span>
<a name="l00003"></a>00003 <span class="comment">    _____   __ __\______   \_____  _______  ______  ____ _______ </span>
<a name="l00004"></a>00004 <span class="comment">   /     \ |  |  \|     ___/\__  \ \_  __ \/  ___/_/ __ \\_  __ \</span>
<a name="l00005"></a>00005 <span class="comment">  |  Y Y  \|  |  /|    |     / __ \_|  | \/\___ \ \  ___/ |  | \/</span>
<a name="l00006"></a>00006 <span class="comment">  |__|_|  /|____/ |____|    (____  /|__|  /____  &gt; \___  &gt;|__|   </span>
<a name="l00007"></a>00007 <span class="comment">        \/                       \/            \/      \/        </span>
<a name="l00008"></a>00008 <span class="comment">  Copyright (C) 2013 Ingo Berg</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">  Permission is hereby granted, free of charge, to any person obtaining a copy of this </span>
<a name="l00011"></a>00011 <span class="comment">  software and associated documentation files (the &quot;Software&quot;), to deal in the Software</span>
<a name="l00012"></a>00012 <span class="comment">  without restriction, including without limitation the rights to use, copy, modify, </span>
<a name="l00013"></a>00013 <span class="comment">  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to </span>
<a name="l00014"></a>00014 <span class="comment">  permit persons to whom the Software is furnished to do so, subject to the following conditions:</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment">  The above copyright notice and this permission notice shall be included in all copies or </span>
<a name="l00017"></a>00017 <span class="comment">  substantial portions of the Software.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment">  THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT</span>
<a name="l00020"></a>00020 <span class="comment">  NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND </span>
<a name="l00021"></a>00021 <span class="comment">  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, </span>
<a name="l00022"></a>00022 <span class="comment">  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, </span>
<a name="l00023"></a>00023 <span class="comment">  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </span>
<a name="l00024"></a>00024 <span class="comment">*/</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef MU_PARSER_TEST_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define MU_PARSER_TEST_H</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;numeric&gt;</span> <span class="comment">// for accumulate</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="mu_parser_8h.html" title="Definition of the standard floating point parser.">muParser.h</a>&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="mu_parser_int_8h.html" title="Definition of a parser using integer value.">muParserInt.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>mu
<a name="l00040"></a>00040 {
<a name="l00042"></a>00042   <span class="keyword">namespace </span>Test
<a name="l00043"></a>00043   {
<a name="l00044"></a>00044     <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00049"></a><a class="code" href="classmu_1_1_test_1_1_parser_tester.html">00049</a> <span class="comment"></span>    <span class="keyword">class </span><a class="code" href="classmu_1_1_test_1_1_parser_tester.html" title="Test cases for unit testing.">ParserTester</a> <span class="comment">// final</span>
<a name="l00050"></a>00050     {
<a name="l00051"></a>00051     <span class="keyword">private</span>:
<a name="l00052"></a>00052         <span class="keyword">static</span> <span class="keywordtype">int</span> c_iCount;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054         <span class="comment">// Multiarg callbacks</span>
<a name="l00055"></a>00055         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f1of1(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) { <span class="keywordflow">return</span> v;};
<a name="l00056"></a>00056         
<a name="l00057"></a>00057         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f1of2(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;};
<a name="l00058"></a>00058         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f2of2(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) {<span class="keywordflow">return</span> v;};
<a name="l00059"></a>00059 
<a name="l00060"></a>00060         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f1of3(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;};
<a name="l00061"></a>00061         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f2of3(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;};
<a name="l00062"></a>00062         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f3of3(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) {<span class="keywordflow">return</span> v;};
<a name="l00063"></a>00063         
<a name="l00064"></a>00064         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f1of4(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;}
<a name="l00065"></a>00065         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f2of4(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;}
<a name="l00066"></a>00066         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f3of4(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) {<span class="keywordflow">return</span> v;}
<a name="l00067"></a>00067         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f4of4(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) {<span class="keywordflow">return</span> v;}
<a name="l00068"></a>00068 
<a name="l00069"></a>00069               <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f1of5(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) { <span class="keywordflow">return</span> v; }
<a name="l00070"></a>00070               <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f2of5(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) { <span class="keywordflow">return</span> v; }
<a name="l00071"></a>00071               <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f3of5(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) { <span class="keywordflow">return</span> v; }
<a name="l00072"></a>00072               <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f4of5(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  ) { <span class="keywordflow">return</span> v; }
<a name="l00073"></a>00073               <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> f5of5(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>,   <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>  , <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) { <span class="keywordflow">return</span> v; }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Min(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal2) { <span class="keywordflow">return</span> (a_fVal1&lt;a_fVal2) ? a_fVal1 : a_fVal2; }
<a name="l00076"></a>00076             <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Max(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal2) { <span class="keywordflow">return</span> (a_fVal1&gt;a_fVal2) ? a_fVal1 : a_fVal2; }
<a name="l00077"></a>00077 
<a name="l00078"></a>00078         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> plus2(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v1) { <span class="keywordflow">return</span> v1+2; }
<a name="l00079"></a>00079         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> times3(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v1) { <span class="keywordflow">return</span> v1*3; }
<a name="l00080"></a>00080         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> sqr(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v1) { <span class="keywordflow">return</span> v1*v1; }
<a name="l00081"></a>00081         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> sign(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v) { <span class="keywordflow">return</span> -v; }
<a name="l00082"></a>00082         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> add(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v2) { <span class="keywordflow">return</span> v1+v2; }
<a name="l00083"></a>00083         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> land(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v2) { <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)v1 &amp; (int)v2; }
<a name="l00084"></a>00084         
<a name="l00085"></a>00085 
<a name="l00086"></a>00086         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> FirstArg(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>* a_afArg, <span class="keywordtype">int</span> a_iArgc)
<a name="l00087"></a>00087         {
<a name="l00088"></a>00088           <span class="keywordflow">if</span> (!a_iArgc) 
<a name="l00089"></a>00089             <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">mu::Parser::exception_type</a>( _T(<span class="stringliteral">&quot;too few arguments for function FirstArg.&quot;</span>) );
<a name="l00090"></a>00090 
<a name="l00091"></a>00091           <span class="keywordflow">return</span>  a_afArg[0];
<a name="l00092"></a>00092         }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> LastArg(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>* a_afArg, <span class="keywordtype">int</span> a_iArgc)
<a name="l00095"></a>00095         {
<a name="l00096"></a>00096           <span class="keywordflow">if</span> (!a_iArgc) 
<a name="l00097"></a>00097             <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">mu::Parser::exception_type</a>( _T(<span class="stringliteral">&quot;too few arguments for function LastArg.&quot;</span>) );
<a name="l00098"></a>00098 
<a name="l00099"></a>00099           <span class="keywordflow">return</span>  a_afArg[a_iArgc-1];
<a name="l00100"></a>00100         }
<a name="l00101"></a>00101 
<a name="l00102"></a>00102         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Sum(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>* a_afArg, <span class="keywordtype">int</span> a_iArgc)
<a name="l00103"></a>00103         { 
<a name="l00104"></a>00104           <span class="keywordflow">if</span> (!a_iArgc) 
<a name="l00105"></a>00105             <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">mu::Parser::exception_type</a>( _T(<span class="stringliteral">&quot;too few arguments for function sum.&quot;</span>) );
<a name="l00106"></a>00106 
<a name="l00107"></a>00107           <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> fRes=0;
<a name="l00108"></a>00108           <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;a_iArgc; ++i) fRes += a_afArg[i];
<a name="l00109"></a>00109           <span class="keywordflow">return</span> fRes;
<a name="l00110"></a>00110         }
<a name="l00111"></a>00111 
<a name="l00112"></a>00112         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Rnd(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v)
<a name="l00113"></a>00113         {
<a name="l00114"></a>00114           <span class="keywordflow">return</span> (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)(1+(v*std::rand()/(RAND_MAX+1.0)));
<a name="l00115"></a>00115         }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> RndWithString(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>*)
<a name="l00118"></a>00118         {
<a name="l00119"></a>00119           <span class="keywordflow">return</span> (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)( 1 + (1000.0f * std::rand() / (RAND_MAX + 1.0) ) );
<a name="l00120"></a>00120         }
<a name="l00121"></a>00121 
<a name="l00122"></a>00122         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Ping()
<a name="l00123"></a>00123         { 
<a name="l00124"></a>00124           <span class="keywordflow">return</span> 10; 
<a name="l00125"></a>00125         }
<a name="l00126"></a>00126 
<a name="l00127"></a>00127         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> ValueOf(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>*)      
<a name="l00128"></a>00128         { 
<a name="l00129"></a>00129           <span class="keywordflow">return</span> 123; 
<a name="l00130"></a>00130         }
<a name="l00131"></a>00131 
<a name="l00132"></a>00132         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> StrFun1(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>* v1)                               
<a name="l00133"></a>00133         { 
<a name="l00134"></a>00134           <span class="keywordtype">int</span> val(0);
<a name="l00135"></a>00135           <a class="code" href="namespacemu.html#ab3b60f8311eb24cf437182a8d5125774" title="Typedef for easily using stringstream that respect the parser stringtype.">stringstream_type</a>(v1) &gt;&gt; val;
<a name="l00136"></a>00136           <span class="keywordflow">return</span> (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)val;
<a name="l00137"></a>00137         }
<a name="l00138"></a>00138 
<a name="l00139"></a>00139         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> StrFun2(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>* v1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v2)                
<a name="l00140"></a>00140         { 
<a name="l00141"></a>00141           <span class="keywordtype">int</span> val(0);
<a name="l00142"></a>00142           <a class="code" href="namespacemu.html#ab3b60f8311eb24cf437182a8d5125774" title="Typedef for easily using stringstream that respect the parser stringtype.">stringstream_type</a>(v1) &gt;&gt; val;
<a name="l00143"></a>00143           <span class="keywordflow">return</span> (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)(val + v2);
<a name="l00144"></a>00144         }
<a name="l00145"></a>00145         
<a name="l00146"></a>00146         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> StrFun3(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>* v1, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v2, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> v3) 
<a name="l00147"></a>00147         { 
<a name="l00148"></a>00148           <span class="keywordtype">int</span> val(0);
<a name="l00149"></a>00149           <a class="code" href="namespacemu.html#ab3b60f8311eb24cf437182a8d5125774" title="Typedef for easily using stringstream that respect the parser stringtype.">stringstream_type</a>(v1) &gt;&gt; val;
<a name="l00150"></a>00150           <span class="keywordflow">return</span> val + v2 + v3;
<a name="l00151"></a>00151         }
<a name="l00152"></a>00152 
<a name="l00153"></a>00153         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> StrToFloat(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a>* a_szMsg)
<a name="l00154"></a>00154         {
<a name="l00155"></a>00155           <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> val(0);
<a name="l00156"></a>00156           <a class="code" href="namespacemu.html#ab3b60f8311eb24cf437182a8d5125774" title="Typedef for easily using stringstream that respect the parser stringtype.">stringstream_type</a>(a_szMsg) &gt;&gt; val;
<a name="l00157"></a>00157           <span class="keywordflow">return</span> val;
<a name="l00158"></a>00158         }
<a name="l00159"></a>00159 
<a name="l00160"></a>00160         <span class="comment">// postfix operator callback</span>
<a name="l00161"></a>00161         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Mega(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal)  { <span class="keywordflow">return</span> a_fVal * (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)1e6; }
<a name="l00162"></a>00162         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Micro(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal) { <span class="keywordflow">return</span> a_fVal * (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)1e-6; }
<a name="l00163"></a>00163         <span class="keyword">static</span> <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> Milli(<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> a_fVal) { <span class="keywordflow">return</span> a_fVal / (<a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a>)1e3; }
<a name="l00164"></a>00164 
<a name="l00165"></a>00165         <span class="comment">// Custom value recognition</span>
<a name="l00166"></a>00166         <span class="keyword">static</span> <span class="keywordtype">int</span> IsHexVal(<span class="keyword">const</span> <a class="code" href="namespacemu.html#a81cc89a81a8872430ab1799b5848c5ca" title="The character type used by the parser.">char_type</a> *a_szExpr, <span class="keywordtype">int</span> *a_iPos, <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> *a_fVal);
<a name="l00167"></a>00167 
<a name="l00168"></a>00168         <span class="keywordtype">int</span> TestNames();
<a name="l00169"></a>00169               <span class="keywordtype">int</span> TestSyntax();
<a name="l00170"></a>00170               <span class="keywordtype">int</span> TestMultiArg();
<a name="l00171"></a>00171               <span class="keywordtype">int</span> TestPostFix();
<a name="l00172"></a>00172               <span class="keywordtype">int</span> TestExpression();
<a name="l00173"></a>00173               <span class="keywordtype">int</span> TestInfixOprt();
<a name="l00174"></a>00174               <span class="keywordtype">int</span> TestBinOprt();
<a name="l00175"></a>00175               <span class="keywordtype">int</span> TestVarConst();
<a name="l00176"></a>00176               <span class="keywordtype">int</span> TestInterface();
<a name="l00177"></a>00177               <span class="keywordtype">int</span> TestException();
<a name="l00178"></a>00178         <span class="keywordtype">int</span> TestStrArg();
<a name="l00179"></a>00179         <span class="keywordtype">int</span> TestIfThenElse();
<a name="l00180"></a>00180 
<a name="l00181"></a>00181         <span class="keywordtype">void</span> Abort() <span class="keyword">const</span>;
<a name="l00182"></a>00182 
<a name="l00183"></a>00183     <span class="keyword">public</span>:
<a name="l00184"></a>00184         <span class="keyword">typedef</span> int (<a class="code" href="classmu_1_1_test_1_1_parser_tester.html" title="Test cases for unit testing.">ParserTester</a>::*testfun_type)();
<a name="l00185"></a>00185 
<a name="l00186"></a>00186               <a class="code" href="classmu_1_1_test_1_1_parser_tester.html" title="Test cases for unit testing.">ParserTester</a>();
<a name="l00187"></a>00187               <span class="keywordtype">void</span> Run();
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="keyword">private</span>:
<a name="l00190"></a>00190         std::vector&lt;testfun_type&gt; m_vTestFun;
<a name="l00191"></a>00191               <span class="keywordtype">void</span> AddTest(testfun_type a_pFun);
<a name="l00192"></a>00192 
<a name="l00193"></a>00193         <span class="comment">// Test Double Parser</span>
<a name="l00194"></a>00194         <span class="keywordtype">int</span> EqnTest(<span class="keyword">const</span> <a class="code" href="namespacemu.html#ae9f8b44d9a97dd397180891e8390c3e9" title="The stringtype used by the parser.">string_type</a>&amp; a_str, <span class="keywordtype">double</span> a_fRes, <span class="keywordtype">bool</span> a_fPass);
<a name="l00195"></a>00195         <span class="keywordtype">int</span> EqnTestWithVarChange(<span class="keyword">const</span> <a class="code" href="namespacemu.html#ae9f8b44d9a97dd397180891e8390c3e9" title="The stringtype used by the parser.">string_type</a>&amp; a_str, 
<a name="l00196"></a>00196                                  <span class="keywordtype">double</span> a_fRes1, 
<a name="l00197"></a>00197                                  <span class="keywordtype">double</span> a_fVar1, 
<a name="l00198"></a>00198                                  <span class="keywordtype">double</span> a_fRes2, 
<a name="l00199"></a>00199                                  <span class="keywordtype">double</span> a_fVar2);
<a name="l00200"></a>00200         <span class="keywordtype">int</span> ThrowTest(<span class="keyword">const</span> <a class="code" href="namespacemu.html#ae9f8b44d9a97dd397180891e8390c3e9" title="The stringtype used by the parser.">string_type</a>&amp; a_str, <span class="keywordtype">int</span> a_iErrc, <span class="keywordtype">bool</span> a_bFail = <span class="keyword">true</span>);
<a name="l00201"></a>00201 
<a name="l00202"></a>00202         <span class="comment">// Test Int Parser</span>
<a name="l00203"></a>00203         <span class="keywordtype">int</span> EqnTestInt(<span class="keyword">const</span> <a class="code" href="namespacemu.html#ae9f8b44d9a97dd397180891e8390c3e9" title="The stringtype used by the parser.">string_type</a>&amp; a_str, <span class="keywordtype">double</span> a_fRes, <span class="keywordtype">bool</span> a_fPass);
<a name="l00204"></a>00204     };
<a name="l00205"></a>00205   } <span class="comment">// namespace Test</span>
<a name="l00206"></a>00206 } <span class="comment">// namespace mu</span>
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 <span class="preprocessor">#endif</span>
<a name="l00209"></a>00209 <span class="preprocessor"></span>
<a name="l00210"></a>00210 
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
